-
-
Notifications
You must be signed in to change notification settings - Fork 100
pr05 Visual Regression Testing #1: Initial Visual Testing Framework #1261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a few comments related to the Gradle setup. I will look into the behaviour and functionality at another stage
@@ -0,0 +1,227 @@ | |||
plugins { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I would recommend that the visual tests are part of the core
package and not their own project in visual-tests
@@ -0,0 +1,227 @@ | |||
plugins { | |||
java | |||
application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The visual tests are not an application, they are part of the test suite
implementation(project(":core")) | ||
|
||
// JUnit BOM to manage versions | ||
testImplementation(platform("org.junit:junit-bom:5.9.3")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use the libs.versions.toml
when adding dependencies, that way we keep deps centralised
@@ -0,0 +1,54 @@ | |||
package processing.test.visual; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any of the code related to the tests should be in the src/test
directory.
@Vaivaswat2244 It seems that the running of the tests is orchestrated via the gradle file, when instead, I think it should be orchestrated by JUnit. I'm not sure how the reporting system might work - maybe it needs gradle for that, but for the tests themselves, there should be a way of structuring them so they are simply the tests, any data needed by them, and they you invoke JUnit to run the tests. In our call tomorrow, let's look closer at this. |
Visual Testing Framework for Processing
Summary
This PR introduces a comprehensive visual regression testing framework for Processing, enabling automated detection of visual changes in rendering output across different platforms. This also opens up the scope for further discussions and modifications to the approach.
Implementation Details
Core Components
1. Sketch Runner with Controlled Execution
setup()
and onedraw()
call2. Test Runner (
VisualTestRunner.java
)3. JUnit 5 Integration (
VisualTest.java
)assertVisualMatch()
helper method4. Image Comparison Algorithm (
ImageComparator.java
)Project Structure
Key Features
1. Hierarchical Screenshot Organization
__screenshots__/suite-name/test-name-platform.png
2. Test Suite Organization
@Tag
annotations for flexible test selection3. Intelligent Pixel Matching
4. Gradle Tasks
Usage Example
Testing Strategy
First Run:
Subsequent Runs:
cc @catilac @Stefterv @mingness @SableRaf